<template>
  <div>
    <h1>{{ this.$route.query.id }}</h1>
    <button @click="goBack()">返回</button>
    <div>
      <h4>实现方式</h4>
      (1)在路由中注册路由----{ path:'/a', name: 'A', component: A }
      <br/>
      (2)绑定事件和要传递的参数以及A页面的路由地址---- useQuery() {
      this.$router.push({ path: '/a', query: { id: this.aaa } }) }
      <br/>
      (3)在A页面获取传递过来的参数----this.$route.query.id
    </div>
  </div>
</template>

<script>
export default {
  name: 'A',
  data() {
    return {
      value: ''
    }
  },
  created() {},
  methods: {
    goBack() {
      this.$router.push('/use-router')
    }
  }
}
</script>

<style scoped></style>
